-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[clang-tidy] Fix typoed option name in bugprone-signed-char-misuse
#161064
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+17
−12
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@llvm/pr-subscribers-clang-tools-extra @llvm/pr-subscribers-clang-tidy Author: Victor Chernyakin (localspook) ChangesFollowing the example of #158282. Full diff: https://github.com/llvm/llvm-project/pull/161064.diff 5 Files Affected:
diff --git a/clang-tools-extra/clang-tidy/bugprone/SignedCharMisuseCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/SignedCharMisuseCheck.cpp
index 1041355a0caad..742d85bb7bab9 100644
--- a/clang-tools-extra/clang-tidy/bugprone/SignedCharMisuseCheck.cpp
+++ b/clang-tools-extra/clang-tidy/bugprone/SignedCharMisuseCheck.cpp
@@ -21,12 +21,12 @@ static constexpr int UnsignedASCIIUpperBound = 127;
SignedCharMisuseCheck::SignedCharMisuseCheck(StringRef Name,
ClangTidyContext *Context)
: ClangTidyCheck(Name, Context),
- CharTypdefsToIgnoreList(Options.get("CharTypdefsToIgnore", "")),
+ CharTypedefsToIgnoreList(Options.get("CharTypedefsToIgnore", "")),
DiagnoseSignedUnsignedCharComparisons(
Options.get("DiagnoseSignedUnsignedCharComparisons", true)) {}
void SignedCharMisuseCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {
- Options.store(Opts, "CharTypdefsToIgnore", CharTypdefsToIgnoreList);
+ Options.store(Opts, "CharTypedefsToIgnore", CharTypedefsToIgnoreList);
Options.store(Opts, "DiagnoseSignedUnsignedCharComparisons",
DiagnoseSignedUnsignedCharComparisons);
}
@@ -39,7 +39,7 @@ BindableMatcher<clang::Stmt> SignedCharMisuseCheck::charCastExpression(
// (e.g. typedef char sal_Int8). In this case, we don't need to
// worry about the misinterpretation of char values.
const auto IntTypedef = qualType(hasDeclaration(typedefDecl(
- hasAnyName(utils::options::parseStringList(CharTypdefsToIgnoreList)))));
+ hasAnyName(utils::options::parseStringList(CharTypedefsToIgnoreList)))));
auto CharTypeExpr = expr();
if (IsSigned) {
diff --git a/clang-tools-extra/clang-tidy/bugprone/SignedCharMisuseCheck.h b/clang-tools-extra/clang-tidy/bugprone/SignedCharMisuseCheck.h
index c735ac634c801..515b85891269c 100644
--- a/clang-tools-extra/clang-tidy/bugprone/SignedCharMisuseCheck.h
+++ b/clang-tools-extra/clang-tidy/bugprone/SignedCharMisuseCheck.h
@@ -35,7 +35,7 @@ class SignedCharMisuseCheck : public ClangTidyCheck {
const ast_matchers::internal::Matcher<clang::QualType> &IntegerType,
const std::string &CastBindName) const;
- const StringRef CharTypdefsToIgnoreList;
+ const StringRef CharTypedefsToIgnoreList;
const bool DiagnoseSignedUnsignedCharComparisons;
};
diff --git a/clang-tools-extra/docs/ReleaseNotes.rst b/clang-tools-extra/docs/ReleaseNotes.rst
index 7cdff86beeec6..29d8bcdd4e68f 100644
--- a/clang-tools-extra/docs/ReleaseNotes.rst
+++ b/clang-tools-extra/docs/ReleaseNotes.rst
@@ -58,8 +58,11 @@ Potentially Breaking Changes
:doc:`bugprone-easily-swappable-parameters
<clang-tidy/checks/bugprone/easily-swappable-parameters>` from
``NamePrefixSuffixSilenceDissimilarityTreshold`` to
- ``NamePrefixSuffixSilenceDissimilarityThreshold``,
- correcting a spelling mistake.
+ ``NamePrefixSuffixSilenceDissimilarityThreshold`` and of check
+ :doc:`bugprone-signed-char-misuse
+ <clang-tidy/checks/bugprone/signed-char-misuse>` from
+ ``CharTypdefsToIgnore`` to ``CharTypedefsToIgnore``,
+ correcting spelling mistakes.
Improvements to clangd
----------------------
diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/signed-char-misuse.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone/signed-char-misuse.rst
index 4edbad5eac81b..3e06e11dffcc7 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/bugprone/signed-char-misuse.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone/signed-char-misuse.rst
@@ -107,7 +107,7 @@ so both arguments will have the same type.
Options
-------
-.. option:: CharTypdefsToIgnore
+.. option:: CharTypedefsToIgnore
A semicolon-separated list of typedef names. In this list, we can list
typedefs for ``char`` or ``signed char``, which will be ignored by the
diff --git a/clang-tools-extra/test/clang-tidy/checkers/bugprone/signed-char-misuse-with-option.cpp b/clang-tools-extra/test/clang-tidy/checkers/bugprone/signed-char-misuse-with-option.cpp
index 9f9d61a56f6c3..c11be9414ac70 100644
--- a/clang-tools-extra/test/clang-tidy/checkers/bugprone/signed-char-misuse-with-option.cpp
+++ b/clang-tools-extra/test/clang-tidy/checkers/bugprone/signed-char-misuse-with-option.cpp
@@ -1,6 +1,6 @@
// RUN: %check_clang_tidy %s bugprone-signed-char-misuse %t \
// RUN: -config='{CheckOptions: \
-// RUN: {bugprone-signed-char-misuse.CharTypdefsToIgnore: "sal_Int8;int8_t"}}' \
+// RUN: {bugprone-signed-char-misuse.CharTypedefsToIgnore: "sal_Int8;int8_t"}}' \
// RUN: --
///////////////////////////////////////////////////////////////////
|
vbvictor
reviewed
Sep 28, 2025
5chmidti
approved these changes
Oct 1, 2025
vbvictor
approved these changes
Oct 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Following the example of #158282.